{% extends "../adminbase.html" %}

{% block content %}
	<h2>{{titletext}}</h2>

    <form action="/editwebsite" method="post">
      <div>
      Sitename:
      {% if is_update %}
      	<span>{{sitename}}</span>
      	<input type=hidden name="sitename" value="{{sitename}}">
      {% else %}
      	<div><INPUT TYPE=TEXT SIZE=40 NAME="sitename" value="{{sitename}}"></div>
      {% endif %}
      </div>
      <div>Owner: {{Website.owneremail}}</div>
      <div>Prefix: <INPUT TYPE=TEXT SIZE=40 NAME="prefix" value="{{Website.prefix}}"></div>
      <div>Sitebase: <INPUT TYPE=TEXT SIZE=40 NAME="sitebase" value="{{Website.sitebase}}"></div>
      <div>Admins: 
      {% for email in Website.adminuseremails %}
      	{{email}} (<a href="/removeuserfromsite?admin=1&sitename={{sitename}}&email={{email}}">del</a>);
      {% endfor %}
      </div>
      <div>Users:
      {% for email in Website.useremails %}
      	{{email}} (<a href="/removeuserfromsite?admin=0&sitename={{sitename}}&email={{email}}">del</a>);
      {% endfor %}
      </div>
      <div><input type="submit" name="mainupdate" value="{{buttontext}}"></div>
    </form>

	{% if is_update %}
	<form action="/editwebsite" method="post">
      	<input type=hidden name="sitename" value="{{sitename}}">
		<div>New Admin (google id, eg: gmail address):</div>
		<div><INPUT TYPE=TEXT SIZE=40 NAME="adminemail" value=""></div>
      	<div><input type="submit" name="newadmin" value="Add Admin"></div>
	</form>

	<form action="/editwebsite" method="post">
      	<input type=hidden name="sitename" value="{{sitename}}">
		<div>New User (google id, eg: gmail address):</div>
		<div><INPUT TYPE=TEXT SIZE=40 NAME="useremail" value=""></div>
      	<div><input type="submit" name="newuser" value="Add User"></div>
	</form>
	{% endif %}
{% endblock %}
